﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class _order : System.Web.UI.Page
{
    public string Classn,straddtime,sname,scardid,sjudge;
	public string strcname,strtel,stremail,strcasetitle,stryytype,strjudge,strygname,strbgname,strcasecode,strcheckcode,strccontent,strcstatus;
    protected void Page_Load(object sender, EventArgs e)
    {

			Classn="预约法官";
			straddtime = DateTime.Now.ToString("yyyy-MM-dd");
			//Response.Write(sname);
			//Response.End();\
			

    }
	
	protected void Button1_Click(object sender, EventArgs e)
        {
				strcname=cname.Text.ToString();
                //strjudge = cbjudge.SelectedItem.Value;
				strjudge = cbjudge.Text.ToString();
//				Response.Write(cbjudge.SelectedValue+"ddd");
//					Response.End();
				strtel=tel.Text.ToString();
				stremail=email.Text.ToString();
				strygname = ygname.Text.ToString();
				strbgname=bgname.Text.ToString();
				strcasecode=casecode.Text.ToString();
				//straddtime=Convert.ToDateTime(addtime.Text.ToString()).ToShortDateString();
				strccontent=ccontent.Text.ToString();
				//strcstatus=cstatus.SelectedValue.ToString();

	
                    Socut.Data.ExecuteNonQuery("insert into [web_order] (name,judge,tel,email,ygname,bgname,casecode,addtime,content) values('" + strcname + "','" + strjudge + "','" + strtel +"','" + stremail +"','" + strygname +"','" + strbgname +"','" + strcasecode + "','" + straddtime + "','" + strccontent +"')");
                    Response.Write("<script>alert('恭喜，网上预约成功！请确保您输入的是正确的联系方式，我们会及时与您取得联系。');location.href='order.aspx';</script>");
					Response.End();
               

            //Response.Write(AllLimit);
        }

    public string htmlstr(string chr)
    {
        if (chr == null)
            return "";
        //chr = chr.Replace("<", "&lt");
        //chr = chr.Replace(">", "&gt");
        chr = chr.Replace("\n", "<br>");
        //chr = chr.Replace("\"", "&quot;");
        //chr = chr.Replace("'", "&#39;");
        //chr = chr.Replace(" ", "&nbsp;");
        chr = chr.Replace("select", "");
        chr = chr.Replace("delete", "");
        chr = chr.Replace("update", "");
        chr = chr.Replace("drop", "");
        //chr = chr.Replace(";", "");
        //chr = chr.Replace("(", "");
        //chr = chr.Replace(")", "");
        chr = chr.Replace("and", "");
        chr = chr.Replace("or", "");
        //chr = chr.Replace("\r", "");
        return (chr);
    }

    static bool IsNumeric(string str)
    {
        if (str == null || str.Length == 0)
            return false;
        foreach (char c in str)
        {
            if (!Char.IsNumber(c))
            {
                return false;
            }
        }
        return true;
    }
}
